<template>
	<div class="a">
		<h1>我是A组件</h1>
	</div>
</template>

<script>
	export default {
		name:'A',
		mounted() {
			this.$bus.$on('get-car',(value)=>{
				alert('我是A组件，我得到了数据：'+value)
			})
		},
		beforeDestroy() {
			this.$bus.$off('get-car')
		},
	}
</script>

<style scoped>
	.a{
		background-color: green;
		padding: 20px;
		width: 50%;
		height: 200px;
	}
</style>